$OpenBSD: patch-Make_openbsd,v 1.4 2016/12/18 18:38:59 jca Exp $
--- Make.openbsd.orig	Tue Nov  1 23:05:17 2016
+++ Make.openbsd	Mon Nov 14 04:00:14 2016
@@ -5,17 +5,17 @@ AS=as
 RANLIB=ranlib
 X11=/usr/X11R6
 CC=gcc
-CFLAGS=-Wall -Wno-missing-braces -ggdb -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -I$(X11)/include -D_THREAD_SAFE $(PTHREAD) -O2
+CFLAGS=-Wall -Wno-missing-braces -I$(ROOT) -I$(ROOT)/include -I$(ROOT)/kern -c -I$(X11)/include -D_THREAD_SAFE $(PTHREAD) $(PORTS_CFLAGS)
 O=o
 OS=posix
 GUI=x11
-LDADD=-L$(X11)/lib64 -L$(X11)/lib -lX11 -lsndio -ggdb
-LDFLAGS=$(PTHREAD)
+LDADD=-L$(X11)/lib64 -L$(X11)/lib -lX11 -lsndio
+LDFLAGS+=$(PTHREAD) $(PORTS_LDFLAGS)
 TARG=drawterm
 AUDIO=sndio
 
 all: default
 
 libmachdep.a:
-	arch=`uname -m|sed 's/i.86/386/; s/macppc/power/; s/socppc/power/; s/x86_64/amd64/; s/sparc64/sun4u/'`; \
+	arch=`uname -m|sed 's/i.86/386/; s/macppc/power/; s/socppc/power/; s/x86_64/amd64/; s/sparc64/sun4u/; s/arm.*/arm/; s/mips64.*/mips/'`; \
 	(cd posix-$$arch &&  make)
